(let* ((alist which-key-prefix-title-alist)
(res (assoc key-lst alist))
(mode-alist (assq major-mode alist))
- (mode-res (when mode-alist (assoc key-lst mode-alist))))
+ (mode-res (when mode-alist (assoc key-lst mode-alist)))
+ (alternate (when (symbolp (key-binding (apply #'vector key-lst)))
+ (symbol-name (key-binding (apply #'vector key-lst))))))
(cond (mode-res (cdr mode-res))
(res (cdr res))
+ ((and (eq which-key-show-prefix 'echo) alternate)
+ alternate)
((and (member which-key-show-prefix '(bottom top))
(eq which-key-side-window-location 'bottom)
echo-keystrokes)
- (if (symbolp (key-binding (apply #'vector key-lst)))
- (symbol-name (key-binding (apply #'vector key-lst)))
+ (if alternate alternate
(concat "Following " (key-description key-lst))))
(t "")))
"Top-level bindings"))